include make.local

FEATURE_EXTRACT = ./libfeat
CFLAGS=-g -std=gnu++0x -O2
INC+=-I$(DYNINST_ROOT)/$(PLATFORM)/include/ -I$(FEATURE_EXTRACT)
LIB+=-L$(DYNINST_LIB) -L$(FEATURE_EXTRACT) -L$(LIBELF) -L$(LIBDWARF)
CXX=g++

DEP = -lcommon -lsymLite -lsymtabAPI -lparseAPI -linstructionAPI -ldynDwarf -ldynElf -ldwarf -lelf -lfeat -ldynElf -ldyninstAPI

OBJ = obj/dataGen.o obj/graphlet.o obj/colors.o obj/supergraph.o obj/config.o obj/feature_analyzer.o obj/produce_features.o obj/statistics.o

all: bin/dataGen libfeat

.PHONY: libfeat
libfeat:
	$(MAKE) -C $(FEATURE_EXTRACT)

bin/dataGen: $(OBJ) libfeat 
	$(CXX) -g $(OBJ) $(LIB) $(DEP) -o $@

obj/dataGen.o: src/dataGen.cpp
	$(CXX) -c $(CFLAGS) $(INC) $^ -o $@

obj/graphlet.o: src/graphlet.cpp
	$(CXX) -c $(CFLAGS) $(INC) $^ -o $@

obj/colors.o: src/colors.cpp
	$(CXX) -c $(CFLAGS) $(INC) $^ -o $@

obj/supergraph.o: src/supergraph.cpp
	$(CXX) -c $(CFLAGS) $(INC) $^ -o $@

obj/config.o: src/config.cpp
	$(CXX) -c $(CFLAGS) $(INC) $^ -o $@

obj/feature_analyzer.o: src/feature_analyzer.cpp
	$(CXX) -c $(CFLAGS) $(INC) $^ -o $@

obj/produce_features.o: src/produce_features.cpp
	$(CXX) -c $(CFLAGS) $(INC) $^ -o $@

obj/statistics.o: src/statistics.cpp
	$(CXX) -c $(CFLAGS) $(INC) $^ -o $@

clean:
	rm -f bin/dataGen
	rm -f obj/*
	rm -f libfeat/libfeat.so*
	rm -f libfeat/*.o
